include(FindPkgConfig)

macro(pkg_dependency DEP_VAR VARIABLE)
    pkg_check_modules(${VARIABLE}PKG ${ARGN} ${VARIABLE})
    add_definitions(${${VARIABLE}PKG_CFLAGS})
    include_directories(${${VARIABLE}PKG_INCLUDE_DIRS})
    link_directories(${${VARIABLE}PKG_LIBRARY_DIRS})
    list(APPEND ${DEP_VAR} ${${VARIABLE}PKG_LIBRARIES})
endmacro()


